{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "332126f9-3524-4223-bcc6-24b9818b77b5",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "from mythic import mythic"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "abfa531f-5e7a-400b-910c-92a62106ccbe",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "mythic_instance = await mythic.login(\n",
    "        username=\"mythic_admin\",\n",
    "        password=\"mythic_password\",\n",
    "        server_ip=\"mythic_nginx\",\n",
    "        server_port=7443,\n",
    "        timeout=-1\n",
    "    )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d84a9fe1-589e-49ec-a843-4c89a877e684",
   "metadata": {},
   "outputs": [],
   "source": [
    "# ################ Delete a number of tasks and callbacks within your current operation ################\n",
    "resp = await mythic.execute_custom_query(\n",
    "        mythic=mythic_instance,\n",
    "        query=\"\"\"\n",
    "    mutation deleteComponents($tasks: [Int], $callbacks: [Int]){\n",
    "        deleteTasksAndCallbacks(callbacks: $callbacks, tasks: $tasks){\n",
    "            status\n",
    "            error\n",
    "            failed_tasks\n",
    "            failed_callbacks\n",
    "        }\n",
    "    }\n",
    "    \"\"\",\n",
    "        variables={\"callbacks\": [2], \"tasks\": [2]},\n",
    "    )\n",
    "print(resp)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9f44d90d-a8b7-4768-80aa-dcbfd2d5c8b4",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
